import { View } from "../../../../mvc/core/View";
import { LayerManager } from "../../../manager/LayerManager";
import { SixtyDefenceInfoPanel } from "./SixtyDefenceInfoPanel";
import { SCopyDefenceInfo } from "../../../../../Message/Public/SCopyDefenceInfo";
import { SceneRange } from "../../../scene/map/SceneRange";
type int = number;
//class SixtyDefenceCopyView
    
    export  class SixtyDefenceCopyView extends View
    {
        constructor()
        {
            super();
            this.layer = LayerManager.uiLayer;
            this.mouseEnabled = false;
            this.createChildren();
            return;
        }

        /* internal  */createChildren(): void
        {
            this._infoPanel = new SixtyDefenceInfoPanel();
            this.addChild(this._infoPanel);
            this.stageResize();
            return;
        }

        public setCopyCode(arg1: int): void
        {
            this._copyCode = arg1;
            this._infoPanel.setCopyCode(arg1);
            return;
        }

        public getCopyCode(): int
        {
            return this._copyCode;
        }

        public setTimeLabel_Ring(arg1: int, arg2: int, arg3: string=""): void
        {
            if (arg3 == "") 
            {
                arg3 = this._infoPanel.RING;
            }
            this._infoPanel.setTimeLabel_Ring(arg1, arg2, arg3);
            return;
        }

        public updateRingBottleExp(): void
        {
            this._infoPanel.updateRingBottleExp();
            return;
        }

        public updateBuildingInfo(arg1: SCopyDefenceInfo): void
        {
            this._infoPanel.updateBuildingInfo(arg1);
            return;
        }

        public stageResize(): void
        {
            if (this._infoPanel.x > SceneRange.display.width - 296) 
            {
                this._infoPanel.x = SceneRange.display.width - 296;
            }
            if (this._infoPanel.y > SceneRange.display.height - 174) 
            {
                this._infoPanel.y = SceneRange.display.height - 174;
            }
            this._infoPanel.updatePosition();
            return;
        }

        public /* override */ hide(): void
        {
            super.hide();
            this._infoPanel.dispose();
            return;
        }

        public /* override */ show(arg1: int=0, arg2: int=0): void
        {
            super.show(arg1, arg2);
            this._infoPanel.x = SceneRange.display.width - 350;
            this._infoPanel.y = 200;
            if (this.parent) 
            {
                this.parent.setChildIndex(this, 0);
            }
            return;
        }

        /* internal */ /* var */_copyCode: int;

        /* internal */ /* var */_infoPanel: SixtyDefenceInfoPanel;
    }
